package demo4;

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int sum = 20;
        double a = scanner.nextDouble();
        char b = scanner.next().charAt(0);

        if (b=='y'){
            sum += 5;
        }

        int extra = (int) Math.ceil(a-1);
        sum += extra;
        System.out.println(sum);

    }
}
